feat(PostgreSQL): 增加数组类型字段支持#106
Merged
Merged
Conversation
Member
Author
|
已补充修复本次 Actions 失败点,PR head 已更新到 本次修复:
已本地验证通过:
|
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.2 #106 +/- ##
============================================
+ Coverage 64.92% 65.63% +0.70%
- Complexity 2341 2390 +49
============================================
Files 343 357 +14
Lines 9375 9977 +602
Branches 940 1123 +183
============================================
+ Hits 6087 6548 +461
- Misses 2810 2867 +57
- Partials 478 562 +84 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目的
columnDef("smallint[]")等方式绕过 ORM 类型系统核心变动
PostgresqlArrayType,统一封装 PostgreSQL 数组类型的DataType、ValueCodec与DataTypeBuilderPostgresqlDialect中注册varchar[]、text[]、smallint[]、integer[]、bigint[]及 PG 内部别名_varchar、_text、_int2、_int4、_int8JdbcParameterBinderR2dbcParameterBinderPostgresqlArrayParametertext[]、smallint[]等按正确 PostgreSQL 数组类型传参,避免text[] = character varying[]类型错误org.testcontainers:testcontainers:1.17.1 -> 1.21.4,兼容当前 Docker Desktop 环境json/jsonb的断言,使其与 PostgreSQL 方言JDBCType.OTHER语义一致测试结果
mvn -pl hsweb-easy-orm-rdb -am -DskipTests compilemvn -pl hsweb-easy-orm-rdb -am -DskipTests test-compilemvn -pl hsweb-easy-orm-rdb -am -Dsurefire.failIfNoSpecifiedTests=false -Dtest=PostgresqlArraySupportTest,PostgresqlTableMetaParserTest,org.hswebframework.ezorm.rdb.supports.postgres.array.PostgresqlArrayTest testmvn -pl hsweb-easy-orm-rdb -am -Dsurefire.failIfNoSpecifiedTests=false -Dtest=org.hswebframework.ezorm.rdb.supports.postgres.array.PostgresqlArrayTest test验证场景
Collection/ Java 数组 / PG 字面量 /PGobjectvarchar[]text[]smallint[]integer[]bigint[]smallint[]text[]saveinsertBatchupdateByIdfindByIdcreateQuerycreateUpdatecreateDeletedeleteById文档同步情况
风险与说明
增量更新(2026-05-19)
contains、ncontains、contained、ncontained、overlap、noverlapcontains/notContains、contained/notContained、overlap/notOverlapcontains -> @>contained -> <@overlap -> &&in兼容为 overlap(任一命中)in$all兼容为 contains(全部命中)org.jacoco:jacoco-maven-plugin:0.8.8 -> 0.8.14,兼容 JDK 21,消除Unsupported class file major version 65instrumentation 警告增量测试结果(2026-05-19)
sh mvnw -pl hsweb-easy-orm-core -Dtest=QueryTest testsh mvnw -pl hsweb-easy-orm-rdb -am -Dtest=PostgresqlArrayTest -Dsurefire.failIfNoSpecifiedTests=false testUnsupported class file major version 65告警增量修复(2026-05-19 / R2DBC 兼容)
PostgresqlArrayType对 JDBCorg.postgresql.util.PGobject的硬依赖getValue(),避免纯 R2DBC / 无 JDBC driver 场景下触发ClassNotFoundExceptionretrieval-pg这类仅使用 PostgreSQL R2DBC 驱动但复用 easyorm PostgreSQL 数组 term / codec 的模块是必需的补充验证
sh mvnw -pl hsweb-easy-orm-rdb -am -Dtest=PostgresqlArrayTest -Dsurefire.failIfNoSpecifiedTests=false test